﻿using System.Data;
using Microsoft.Practices.EnterpriseLibrary.Data;

namespace Koonsoft.HYCRM.DAL
{
    public class BankDAL
    {
        private Database database = DatabaseFactory.CreateDatabase("KOONCRMDB");

        /// <summary>
        /// 获取所有银行
        /// </summary>
        /// <returns></returns>
        public DataTable GetBanks()
        {
            const string sql = "select * from bank";

            using (var cmd = database.GetSqlStringCommand(sql))
            {
                return database.ExecuteDataSet(cmd).Tables[0];
            }
        }
    }
}
